package com.iwhalecloud.bss.kite.cucc.service.job.collectiongroup;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.iwhalecloud.bss.kite.cucc.client.api.job.collectiongroup.IKiteBatchAcceptDetailService;
import com.iwhalecloud.bss.kite.cucc.dataservice.mapper.batch.KiteBatchAcceptDetailMapper;

import com.ztesoft.bss.common.util.SpringUtil;

/**
 * Created by huanghaosheng on 2021/6/1 9:38
 */
@Service
public class KiteBatchAcceptDetailService implements IKiteBatchAcceptDetailService {

    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
    @Override
    public void updateKiteBatchAcceptDetailCheckStatus(String checkStatus, Long detailId, String checkResult, Long batchId) {
        KiteBatchAcceptDetailMapper kiteBatchAcceptDetailMapper = SpringUtil.getBean(KiteBatchAcceptDetailMapper.class);
        kiteBatchAcceptDetailMapper.updateKiteBatchAcceptDetailCheckStatus(checkStatus, detailId, checkResult, batchId);
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
    @Override
    public void updateKiteBatchAcceptDetailStatus(String statusCd, Long detailId, String dealResult, Long batchId) {
        KiteBatchAcceptDetailMapper kiteBatchAcceptDetailMapper = SpringUtil.getBean(KiteBatchAcceptDetailMapper.class);
        kiteBatchAcceptDetailMapper.updateKiteBatchAcceptDetailStatus(statusCd, detailId, dealResult, batchId);
    }
}
